#pragma once
#include "autoricheditctrl.h"
#include "MyToolBar.h"
#include "RangeSet.h"
// CScriptureRef dialog

class CScriptureRef : public CPropertyPage
{
	DECLARE_DYNAMIC(CScriptureRef)

public:
	CScriptureRef();
	virtual ~CScriptureRef();

// Dialog Data
	enum { IDD = IDD_SCRIPREF };

protected:
  CMyToolBar m_wndFormatBar;
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	DECLARE_MESSAGE_MAP()	
public:
  static BOOL Detect;
	CAutoRichEditCtrl richCtrl;
  static CStringArray verseArray;
  
  CRangeSet XLimits;
  static CStringArray Xrefs;
  static CStringArray Footnotes;

  static void AddFootNotes(CString& VerseText, int verse);
	static void AddXref(CString& VerseText, int verse);
	

public:
	void SetText(CString text);
	virtual BOOL OnInitDialog();
	afx_msg void OnSize(UINT nType, int cx, int cy);
  afx_msg void OnCrossLinksMgr();
  afx_msg void OnCopy();
  afx_msg void OnSelectAll();
	afx_msg void OnZoom();
	afx_msg void OnUpdateZoom(CCmdUI *pCmdUI);
  afx_msg void OnEnMsgfilter(NMHDR *pNMHDR, LRESULT *pResult);

private:
  CRangeSet tips;
	int LoadToolbar(void);	// this function loads the toolbar on the scripture reference page

  void ZoomText();
  void OnRightButtonDown();
  void OnLeftButtonDown();
  void DetectTips();
  void SetXLimits();
  
};
